package com.sunyard.manage.service;

import com.sunyard.dal.bo.device.lock.LockAddBO;
import com.sunyard.dal.bo.device.lock.LockEditorBO;
import com.sunyard.dal.bo.device.lock.LockQueryBO;
import com.sunyard.dal.bo.PaginationBO;
import com.sunyard.dal.dto.LockQueryResDTO;
import com.sunyard.dal.entity.Lock;
import com.sunyard.dal.entity.Operator;
import com.sunyard.utils.Response.BaseResult;
import com.sunyard.utils.manage.DataGrid;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface LockService {
    /**
     * 分页查询锁具信息
     *
     * @param queryBO [queryBO]
     * @return BaseResult<DataGrid < LockQueryResDTO>>
     **/
    BaseResult<DataGrid<LockQueryResDTO>> getLockByPage(PaginationBO<LockQueryBO> queryBO, HttpServletRequest request);

    /**
     * 添加锁
     *
     * @param addBO   addBO
     * @param request [addBO, request]
     * @return BaseResult
     **/
    BaseResult addLock(LockAddBO addBO, HttpServletRequest request);

    /**
     * 修改锁
     *
     * @param lockEditorBO
     * @param request      [addBO, request]
     * @return BaseResult
     **/
    BaseResult<Lock> updateLock(LockEditorBO lockEditorBO, HttpServletRequest request);

    /**
     * 删除锁
     *
     * @param lock
     * @param request [addBO, request]
     * @return BaseResult
     **/
    BaseResult deleteLock(Lock lock, HttpServletRequest request);


    BaseResult exportLock(HttpServletRequest request, HttpServletResponse response) throws Exception;

    BaseResult<List<Operator>> selectUserInfo(Lock lock, HttpServletRequest request);

    BaseResult importInfo(MultipartFile file, LockService lockService) throws Exception;

    void addLocksList(List<Lock> list);

    BaseResult audit(Lock lock, HttpServletRequest request);

}
